From 3bac133986e7828cd0c5aa22af40e1bf95036180 Mon Sep 17 00:00:00 2001 From: ducloc464 Date: Fri, 14 Feb 2025 18:00:16 +0700 Subject: [PATCH] fix: configure lxc container POST request Signed-off-by: ducloc464 --- applications/luci-app-lxc/luasrc/controller/lxc.lua | 1 + applications/luci-app-lxc/luasrc/view/lxc.htm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/luci-app-lxc/luasrc/controller/lxc.lua b/applications/luci-app-lxc/luasrc/controller/lxc.lua index 1682def279..5b603e52d9 100644 --- a/applications/luci-app-lxc/luasrc/controller/lxc.lua +++ b/applications/luci-app-lxc/luasrc/controller/lxc.lua @@ -140,6 +140,7 @@ function lxc_configuration_set(lxc_name) luci.http.prepare_content("text/plain") local lxc_configuration = luci.http.formvalue("lxc_conf") + lxc_configuration = luci.http.urldecode(lxc_configuration, true) if lxc_configuration == nil then util.perror("lxc error: config formvalue is empty") return diff --git a/applications/luci-app-lxc/luasrc/view/lxc.htm b/applications/luci-app-lxc/luasrc/view/lxc.htm index 69025ad6d3..e5d261c6e8 100644 --- a/applications/luci-app-lxc/luasrc/view/lxc.htm +++ b/applications/luci-app-lxc/luasrc/view/lxc.htm @@ -250,7 +250,7 @@ local target = nx.uname().machine var lxc_name = textarea.dataset['id']; var lxc_conf = textarea.value; - new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, "lxc_conf=" + encodeURIComponent(lxc_conf), + new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, {"lxc_conf": encodeURIComponent(lxc_conf)}, function(x) { if (!x || x.responseText != "0") -- 2.30.2